Skip to content

Add reusable workflow for checking build output#1

Merged
snoack merged 1 commit into
masterfrom
action-build-check
May 19, 2026
Merged

Add reusable workflow for checking build output#1
snoack merged 1 commit into
masterfrom
action-build-check

Conversation

@snoack
Copy link
Copy Markdown
Contributor

@snoack snoack commented May 15, 2026

This extracts the shared build action used by work-diary and update-changelog-action into a reusable workflow.


This change is Reviewable

@snoack snoack requested a review from pkaminski May 15, 2026 21:16
Copy link
Copy Markdown
Member

@pkaminski pkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkaminski reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

        with:
          node-version: "24"
          cache: yarn

At least Codex was convinced that actions/setup-node was incapable of caching Yarn 4 correctly, and explicit use of actions/cache was required. Are you sure this works? If so, should backport to a bunch of other workflows.

@snoack snoack requested a review from pkaminski May 15, 2026 23:23
Copy link
Copy Markdown
Contributor Author

@snoack snoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snoack made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pkaminski).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, pkaminski (Piotr Kaminski) wrote…

At least Codex was convinced that actions/setup-node was incapable of caching Yarn 4 correctly, and explicit use of actions/cache was required. Are you sure this works? If so, should backport to a bunch of other workflows.

Well, Codex came up with this simplification, and asking it about it again now, it insists that this works with Yarn 4 since actions/setup-node internally uses actions/cache. I did no test it. I suppose once this has been merged we can rerun the CI for the integration changes in work-diary and update-changelog-action and see if it works.

Copy link
Copy Markdown
Member

@pkaminski pkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkaminski made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, snoack (Sebastian Noack) wrote…

Well, Codex came up with this simplification, and asking it about it again now, it insists that this works with Yarn 4 since actions/setup-node internally uses actions/cache. I did no test it. I suppose once this has been merged we can rerun the CI for the integration changes in work-diary and update-changelog-action and see if it works.

How would we know it's working, though?

The Yarn maintainers seem to think (or did, 5 years ago) that caching node_modules and .yarn/install-state.gz would often be beneficial for our configuration.

@snoack snoack force-pushed the action-build-check branch from 0298cb7 to 0ae5a4c Compare May 18, 2026 22:34
@snoack snoack requested a review from pkaminski May 18, 2026 22:34
Copy link
Copy Markdown
Contributor Author

@snoack snoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snoack made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on pkaminski).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

How would we know it's working, though?

Besides making sure the CI passes, we watch for cache related log messages.

The Yarn maintainers seem to think (or did, 5 years ago) that caching node_modules and .yarn/install-state.gz would often be beneficial for our configuration.

The premise is that by caching node_modules and .yarn/install-state.gz instead of caching the Yarn cache you eliminate overhead due to compression (disabled by default in Yarn 4) and bookkeeping in Yarn. We already invalidate the cache on dependency changes, so we wouldn't lose cachability of packages across CI runs with changed dependencies — we never had that. Note sure how significant an optimization this is in 2026 with Yarn 4 though, and the downside would be a slightly more complex workflow configuration since I would have to reintroduce a separate actions/cache step.

Also if we are concerned about yarn install (from Yarn cache) overhead, work-diary and update-changelog-action aren't the largest offenders; reviewable-server and reviewable-client have a much larger npm dependency footprint and caching the Yarn cache is consistent with what we are doing there.

Copy link
Copy Markdown
Member

@pkaminski pkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkaminski reviewed 1 file and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, snoack (Sebastian Noack) wrote…

How would we know it's working, though?

Besides making sure the CI passes, we watch for cache related log messages.

The Yarn maintainers seem to think (or did, 5 years ago) that caching node_modules and .yarn/install-state.gz would often be beneficial for our configuration.

The premise is that by caching node_modules and .yarn/install-state.gz instead of caching the Yarn cache you eliminate overhead due to compression (disabled by default in Yarn 4) and bookkeeping in Yarn. We already invalidate the cache on dependency changes, so we wouldn't lose cachability of packages across CI runs with changed dependencies — we never had that. Note sure how significant an optimization this is in 2026 with Yarn 4 though, and the downside would be a slightly more complex workflow configuration since I would have to reintroduce a separate actions/cache step.

Also if we are concerned about yarn install (from Yarn cache) overhead, work-diary and update-changelog-action aren't the largest offenders; reviewable-server and reviewable-client have a much larger npm dependency footprint and caching the Yarn cache is consistent with what we are doing there.

Yeah, I'm not concerned about these internal tool packages, just using this as a platform to figure out the best approach to use consistently across our codebase.

I think the simple approach here is better and Codex misled me before. Let's go with that throughout — could you see if Codex will undo the mess it made? Thanks.

This extracts the shared build action used by work-diary and
update-changelog-action into a reusable workflow.
@snoack snoack force-pushed the action-build-check branch from 0ae5a4c to 5a19659 Compare May 19, 2026 20:22
Copy link
Copy Markdown
Contributor Author

@snoack snoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snoack made 1 comment.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, pkaminski (Piotr Kaminski) wrote…

Yeah, I'm not concerned about these internal tool packages, just using this as a platform to figure out the best approach to use consistently across our codebase.

I think the simple approach here is better and Codex misled me before. Let's go with that throughout — could you see if Codex will undo the mess it made? Thanks.

There is a problem with this approach though: Before corepack enable, yarn is Yarn 1.x installed by default on the runner. So we have some kind of a circular dependency here: corepack enable requires actions/setup-node which requires the right Yarn version (installed via corepack) if configured with cache: yarn. I suppose we have to revert to an explicit caching step.

Copy link
Copy Markdown
Member

@pkaminski pkaminski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pkaminski reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, snoack (Sebastian Noack) wrote…

There is a problem with this approach though: Before corepack enable, yarn is Yarn 1.x installed by default on the runner. So we have some kind of a circular dependency here: corepack enable requires actions/setup-node which requires the right Yarn version (installed via corepack) if configured with cache: yarn. I suppose we have to revert to an explicit caching step.

ChatGPT's suggestion was to run setup-node twice, don't know if that's better or worse:

- uses: actions/checkout@v6

- uses: actions/setup-node@v6
  with:
    node-version: 24

- run: corepack enable

- uses: actions/setup-node@v6
  with:
    node-version: 24
    cache: yarn
    cache-dependency-path: |
      yarn.lock
      .yarnrc.yml

- run: yarn install --immutable

Copy link
Copy Markdown
Contributor Author

@snoack snoack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snoack made 1 comment and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on snoack).


.github/workflows/check-build-output.yaml line 18 at r1 (raw file):

Previously, pkaminski (Piotr Kaminski) wrote…

ChatGPT's suggestion was to run setup-node twice, don't know if that's better or worse:

- uses: actions/checkout@v6

- uses: actions/setup-node@v6
  with:
    node-version: 24

- run: corepack enable

- uses: actions/setup-node@v6
  with:
    node-version: 24
    cache: yarn
    cache-dependency-path: |
      yarn.lock
      .yarnrc.yml

- run: yarn install --immutable

I suppose that could work, but I can't say that I like it any better. Also what I have implemented now is 100% consistent with what we are already doing everywhere else.

@snoack snoack merged commit d0eaa46 into master May 19, 2026
3 checks passed
@snoack snoack deleted the action-build-check branch May 19, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants